package com.xzy.e;

import com.xzy.e.impl.*;
import com.xzy.service.*;
import org.springframework.context.annotation.Bean;

/**
 * 自动依赖注入的方式：@Autowired + 属性|方法
 *
 * @author xzy
 * @date 2021/12/7  21:48
 */
public class BeanConfig {

    @Bean
    public BookService bookService1() {
        return new BookServiceImpl("bookService1");
    }

    @Bean
    public BookService bookService2() {
        return new BookServiceImpl("bookService2");
    }

    @Bean
    public CourseService courseService1() {
        return new CourseServiceImpl("courseService1");
    }

    @Bean
    public CourseService courseService2() {
        return new CourseServiceImpl("courseService2");
    }

    @Bean
    public SchoolService schoolService1() {
        return new SchoolServiceImpl("schoolService1");
    }

    @Bean
    public SchoolService schoolService2() {
        return new SchoolServiceImpl("schoolService2");
    }

    @Bean
    public StudentService studentService1() {
        return new StudentServiceImpl("studentService1");
    }

    @Bean
    public StudentService studentService2() {
        return new StudentServiceImpl("studentService2");
    }

    @Bean
    public TeacherService teacherService1() {
        return new TeacherServiceImpl("teacherService1");
    }

    @Bean
    public TeacherService teacherService2() {
        return new TeacherServiceImpl("teacherService2");
    }
}
